<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

class login extends Model
{
    //
    public function __construct(){
    	$this->theDatas = new \App\model\dataCore();
    }

    public function login($post){
    	$where['account'] = $post['account'];
    	$resoult = $this->theDatas->search('sots_user', $where);
    	if (password_verify($post['password'].substr($post['account'], 2, 1), $resoult[0]->password)) {
    		return $success = 1;
    	}else{
    		return $false = 0;
    	}
    }
}
